The patch support ACPI UP Guest Windows 2000, XP and 2003, based on
this we are going to add more support on SMP and 64bit Windows( which
are only working in ACPI mode) later. We tested: in ia32 guest:
a. Installation and boot of Windows XP sp2 and 2003 server in ACPI
mode
b when boot to both window, no yellow mark in device manger and USB,
network card and IDE DMA are working.
c. clean boot (without ACPI related errors) on UP and 4 vcpu rhel4u1
SMP guest and got ioapic Interrupt assigned according to ACPI DSDT
table's _PRT table's GSI.
To minimize the implementation efforts to satisfy the ACPI OS
installation and boot, we implemented ACPI only event logical model by
emulating ACPI hardware based on PIIX4 (Intel 82371ab) by: Populating
the PIIX4 ACPI bridge PCI configuration space; Adding ACPI timer
(required during windows installation/boot), PM1 event register block
and PM1 control register block (both are required during
installation/boot, shutdown, entering and leaving PM S state if adding
those features later), we provided full ACPI hardware registers above
using byte/word/dword access per ACPI spec requirement.
The patch also fixed many existing hvm ACPI related bugs, such as
warnings when boot to ACPI UP and SMP guest Linux OS; adding new ACPI
_PRT table reporting PCI IRQ routing table in PIC mode, adding new _PRT
table in APIC mode, that fixed no IRQ GSI cause it is forced to shutdown
when OS find new device to assign IRQ without ACPI event service; The
patch also fixed the ACPI DSDT table's PCI resource conflict with guest
e820 table when booting and installing ACPI Windows; we also added ACPI
shutdown service by incorporating the code in ACPI "hardware enable
register writer" from Ben's Virtual Iron's team's patch in changeset
9989:f8d20c3e4225.
We only provide minimum power management requirement support per spec-c1
and S5 for shutdown, may be S4 (hibernating which is meaningful for user
to save their working section) in the future.
Please note, current patch needs to have following switches in guest
configuration to enable proper ACPI support
a. need to add ACPI=1 (apic=1 if boot SMP Linux guest plus vcpu=
number want to test) in xmexample.hvm
b. need to add USB support: USB=1 and usbdevice='device' (or
='tablet') as the pm register base is static..., I will adding dynamic
ACPI FADT table for pm register base pointer later.
When installing guest OS in ACPI mode, need to manually tell Windows
setup program to install single core ACPI HAL:
After passing the 1st screen of windows setup of install Windows,
the first thing you'll see at the bottom of the screen is the
option to press F6 if you need to install a SCSI or RAID
controller. Don't press F6. Press F5 instead. This will take
you to a separate menu of Hardware Abstraction Layer's where
you can choose an appropriate HAL .The choices will be:
ACPI Multiprocessor PC
ACPI Uniprocessor PC
Advanced Configuration and Power Interface (ACPI) PC
...
Standard PC
Standard PC with C-Step i486
Please select "Advanced Configuration and Power Interface (ACPI) PC"
using current patch.
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
[LINUX] Kernel should not send out IPv6 autoconfig multicast
packets if the interface is not marked as multicast-capable. Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
[ACM] Complete the conversion of acm_ops using Xen handles instead
of void pointers. It also fixes a recently slipped in acm bug that hangs
Xen when a domain is destroyed.
[XEN] Use correct xen_pfn_t type in implementation of XENMEM_exchange.
Avoids compile errors on ppc. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
[LINUX] Add spurious page-fault detection, intended primarily
for spurious write faults on mappings that have been
changed from read-only to writable. If a CPU has a stale
read-only entry in its TLB, it is allowed to fault on
the next write access without re-walking the page table. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Make the spurious page-fault detection logic
more robust. In particular it must be able to handle
spurious write faults on mappings that have been
changed from read-only to writable. If a CPU has a stale
read-only entry in its TLB, it is allowed to fault on
the next write access without re-walking the page table. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] PTE updates do not need to use CMPXCHG instruction.
This is because the updates are already protected by a
per-domain lock. Using straightforward memory writes has
two advantages:
1. Faster
2. More correct (previously we could race accessed/dirty
bit updates by other CPUs). Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Use new XENMEM_exchange hypercall (where possible)
to provide watertight implementations that should never crash
in ENOMEM situations. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] New memory_op XENMEM_exchange. Allows atomic
exchange of one memory reservation for another of the
same size, but with different properties. Signed-off-by: Keir Fraser <keir@xensource.com>
[MINI-OS] Fix for event initialisation in Mini-OS. All events are masked when
the system is started up. This prevents from getting spurious events
between hypercall to bind an event-channel and registering
appropriate event handler. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
[LINUX] Network buffers do not need to be multi-page contiguous
for unprivileged domains (in any case, can fall back to swiotlb).
On non-privileged domain of Xen/IA64, this caused some trouble. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[TOOLS] Introduce xc_evtchn_*() interface for interacting with /dev/xen/evtchn.
No longer open the device as non-blocking: all reads immediately follow
a select() on the device indicating it's ready to read.
[LINUX] Only destroy a machine-contiguous memory region if
it really is contiguous (e.g., create_contiguous did not fail). Signed-off-by: Keir Fraser <keir@xensource.com>
[IA64] let VMM do itc sync for guest on VTI domain
Previously, on SMP VTI-domain, Guest OS was responsible for
syncing itc by calling ia64_sync_itc, but the round trip may
be very large on VTI domain, that may cause guest itcs are
not synced well and cause guest wall clock is not accurate.
This patch intends to fix this issue, when guest wants to sync
itc( vcpus other than vcpu0 write itc), VMM directly get vcpu0
itc for other vcpus.
[LINUX][PAE] More fixes to pgd allocation. Since allocating pmds
can sleep, we could race save/restore and end up with stale
machine addresses stores in pgd entries. Avoid this by
remembering virtuall addresses and translating to machine
addresses all at the end and protected by the pgd_lock. Signed-off-by: Keir Fraser <keir@xensource.com>
[NET] front: Discard packets in tx ring rather than attempting retransmit
when reconnecting to backend driver (e.g., after save/restore or migrate).
Two main reasons for this:
1. The retransmit code is broken for fragmented packets. It would need
a rewrite to cope with the new scatter-gather format.
2. We will drop packets anyway, in both directions (e.g., takes some
time for received packets to be redirected to new virtual interface;
also further transmitted packets from the network stack are dropped
after we call netif_carrier_off(), so even if we retransmite what's
already in the ring it is likely that some subsequent packets will
already be lost).
If this causes downtimes that are too long (particularly for live
relocation) then the whole strategy for buffering packets while the
frontend-backend connection is severed needs to be considered.
[LINUX][PAE] Improve allocation strategy when PAE pgdirs must be below 4GB.
Moving the re-allocation to low memory into pgd_alloc() has several
advantages:
1. Avoids race with save/restore where pgdir may end up above 4GB after
save/restore.
2. If pgdir cannot be re-allocated we can return failure to the caller
rather than BUG().
3. Slightly reduces diff against native Linux code. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX][BLK] front: More care over device teardown.
1. We must ensure gnttab callbacks are disabled and all work
flushed before tearing down device state. A new gnttab interface
call is added for this purpose.
2. blkif_free() must check for a request_queue before deref'ing it. Signed-off-by: Keir Fraser <keir@xensource.com>
Now guest vhpt table of VMX domain is searched to insert some
entry into vtlb on the fly. However previous guard on memory
attribute is only done for guest itc.d emulation. That breaks
VGA acceleration and this patch fixes it by moving check to
right place.
[IA64] cleanup warning in xen/arch/ia64/linux-xen/time.c
Remove a wrong cleanup in xen/arch/ia64/linux-xen/time.c
itc_ratio.num and itc_ratio.den are defined u64
in xen/include/asm-ia64/linux-xen/asm/pal.h.
These are the below.
typedef struct pal_freq_ratio {
u64 den : 32, num : 32; /* numerator & denominator */
} itc_ratio, proc_ratio;
This is a port of a newer upsteam efi.c to xen/ia64. For the most
part, this patch is simply incorporating this upstream linux-ia64
patch into the tree:
To support this new code, xensetup needed to be modified to relocate
the dom0 kernel and initrd images without using efi_memmap_walk() as
this can no longer be called until after reserve_memory(). The dom0
kernel and initrd images are now only moved if necessary and the xen
MDT entry is expanded to cover the xenheap area and any relocated dom0
bits.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XM-TEST] Fix 02_block_device_write_verify.py test to parse md5sum output correctly.
The 02_block_device_write_verify.py test that I wrote is failing because
the regular expression to extract the md5sum is only looking at the
first line of output and the sum is in a subsequent line (after the
output from dd).
This patch fixes the test by adding the multiline flag to the search
parameters so that the search looks in all lines of the output for the
md5sum. I added the multiline flag in all searches to make the tests
more robust against changes in the output format of the commands used.
I'm not exactly sure how this slipped through my testing. I suspect
that I forgot to install the new python file after updating the test to
use dd and then tested the old version a second time by accident.
Either that or it really did work when I tested it and the output format
has changed for some reason.
I tested this patch against xen-unstable 10326 and the 02 test fails
without the patch and succeeds with it.
Thanks to James Dykman for some help with this.
Signed-off-by Harry Butterworth <butterwo@uk.ibm.com>
[ACM] Provide the framework needed for resource labeling.
Subsequent patches will follow in the coming weeks that will enable
Xen ACM to control assignment of resources (e.g., block devices and
networking) to virtual machines based on resource labels and the
active security policy.
Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com> Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
[TOOLS][BUILDER] Extend Elf header checks for multiple architectures.
Based on a patch from Hollis Blanchard. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Export some tlb-flush functions to modules, which are
directly accessible via macros in tlbflush.h. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Fix compatibility with future guests which may try to
use hypercalls >= NR_hypercalls. These must fail with ENOSYS,
but the current strategy of masking off the high-order bits of
the hypercall number means we instead map those hypercalls onto
lower-numbered hypercalls with unpredictable results. This patch
replaces masking with an explicit compare-and-jump. Signed-off-by: Keir Fraser <keir@xensource.com>
Fix race in device resume path - need to ensure we add the watch only
after the device-specific resume code has run. Also removed some unused /
usless code from netfront.c.
[LINUX] Fix interaction between idle loop and RCU subsystem.
There is a problem with the current implementation of stop_hz_timer in
arch/i386/kernel/time-xen.c where the hz timer can be stopped on a CPU
which has RCU callbacks pending.
This patch backports a new RCU API created to fix this problem for the
s390 implementation of stop_hz_timer and also updates the time-xen.c
implementation of stop_hz_timer to call the new API.
Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
[HVM][VMX] Fix the build with certain versions of gcc.
Restrict register choices to this which are byte addressable. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM][VMX] Provide right view of cpuid to the HVM guests.
Some of the CPU features such as APIC, PAE, MTRR, HT are virtualized;
while others are not virtualized yet such as TM1, TM2, MCA and there are
some features which do not need virtualization such as MMX. With the
patch Guest sees only those processor features in the cpuid which are
virtualized in the hyper visor, or do not need any virtualization in
hypervisor.
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Asit Mallick <asit.k.mallick@intel.com>
[HVM][DM] Backport the USB support from QEMU 0.8.1 to the current Xen
device model. To support USB there are two new optional config lines
that can be added to the guest config file:
usb=1
This will enable USB without defining a specific USB device.
This option is assumed and not needed if the `usbdevice' option
is given.
usbdevice='device'
This will enable USB and also enable support for the given device.
Currently, the only two devices are `mouse' (a PS/2 mouse) and
`tablet' (an absolute pointing device). The advantage of `tablet'
is that Windows guests will automatically recognize and support this
device so specifying the config line:
usbdevice='tablet'
will create a mouse that works transparently with Windows guests
under VNC. (Linux doesn't recognize the USB tablet yet so Linux
guests under VNC will still need the Summagraphics emulation.)
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
[HVM][VMX] Cleanups and fixes to VMCS lifecycle.
1. Maintain a 'launched' software flag to select between
VMLAUNCH and VMRESUME.
2. Take more care with VMPTRLD/VMCLEAR.
Also various other fixes (e.g., safe testing of
condition codes after executing a VMX instruction).
[LINUX] Fix IRQ SMP affinity logic for event channels.
The logic now mimics native x86 behaviour: a request to change
affinity via /proc is held until the next interrupt on that
event channel. So /proc/irq/n/smp_affinity may not change
immediately!
Other notes:
1. CPU-specific interrupts silently ignore requests to change
affinity. For example, resched0, timer0, callfunc0, ...
2. Reading smp_affinity always returns a cpumask containing
a single cpu. An event channel can only be bound to a single
cpu at a time. Neither Xen nor XenLinux implement IRQ
balancing: requires a user-space balancing daemon.
[XEN] Replace direct common-code access of evtchn_upcall_mask
with local_event_delivery_* accessors.
Notes:
1. Still some (read-only, debug) use in keyhandler.c
2. Still accesses through current->vcpu_info.
Both above may need to be compiled only for architectures
that use event channels.
[LINUX] Remove the only use of evtchn_upcall_mask in common code.
Replace with an assertion of irq_disabled(). Signed-off-by: Keir Fraser <keir@xensource.com>
[IA64] passthrough EFI_ACPI_MEMORY_NVS and EFI_RESERVED_TYPE
According to the EFI spec, firmware may describe ACPI tables loaded
at runtime in EFI_RESERVED_TYPE or EFI_ACPI_MEMORY_NVS memory ranges.
This patch adds these to the list of memory types we pass through for
dom0. This allows Xen to boot on HP Superdomes.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEN] VCPU operation register_runstate should work even when
called from non-local VCPU. Necessary as Linux always calls
this operation from VCPU0 during secondary-VCPU bringup. Signed-off-by: Keir Fraser <keir@xensource.com>
[ACM] Replace enumerations with macros with qualified names.
Old unqualified enumeration names polluted the global namespace. Signed-off-by: Keir Fraser <keir@xensource.com>